package day0520;

public class Test8 {
    public static void main(String[] args) {
        String r=judge(5, 2025);
        System.out.println(r);
    }
    public static String judge(int month, int year) {
        switch(month){
            case 1:
                //如果month等于1， 就执行第一个case后的代码，并用break强制结束switch结构。
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12: return "31天";
            case 4:
            case 6:
            case 9:
            case 11:   return "30天";
            case 2:   return year%400==0||(year%4==0&&year%100!=0)? "29天": "28天";
            default:  return "月份值无效";
        }
    }
}
